package com.gumanx;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;

public class BlockWardHarming extends BlockGlass {
	
	public BlockWardHarming(int par1, Material par2Material, boolean localFlag) {
		
		super(par1, par2Material, localFlag);
		this.setLightOpacity(1);
		this.setHardness(20);
		this.setResistance(3000f);
		this.setCreativeTab(CreativeTabs.tabBlock);
	}

	public int quantityDropped(Random par1Random) {
		return 0;
	}

	/**
	 * Returns a bounding box from the pool of bounding boxes (this means this
	 * box can change after the pool has been cleared to be reused)
	 */
	public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World,
			int par2, int par3, int par4) {
		float f = 0.0625F;
		return AxisAlignedBB.getAABBPool().getAABB((double) ((float) par2 + f),
				(double) par3, (double) ((float) par4 + f),
				(double) ((float) (par2 + 1) - f),
				(double) ((float) (par3 + 1) - f),
				(double) ((float) (par4 + 1) - f));
	}

	/**
	 * Returns the bounding box of the wired rectangular prism to render.
	 */
	public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World,
			int par2, int par3, int par4) {
		float f = 0.0625F;
		return AxisAlignedBB.getAABBPool().getAABB((double) ((float) par2 + f),
				(double) par3, (double) ((float) par4 + f),
				(double) ((float) (par2 + 1) - f), (double) (par3 + 1),
				(double) ((float) (par4 + 1) - f));
	}
	
	public void onEntityCollidedWithBlock(World par1World, int par2, int par3,
			int par4, Entity par5Entity) {
		par5Entity.attackEntityFrom(DamageSource.cactus, 3);
	}

	public void registerIcons(IconRegister iconReg) {
		blockIcon = iconReg.registerIcon("gumanx:wardHarming");
	}

}
